package InnerClass;

/**
 * @author BianWenKai
 * @DATE 2021/8/29 - 14:08
 **/
public class AnonymousInnerClass {

    public static void main(String[] args) {
        //匿名内部类，没有初始化类的名字，不用将对象实例保存到变量中
        new Student().study();

        new Person() {
            @Override
            public void delete() {
                System.out.println("删除成功");
            }
        };
    }
}


class Student{
    private String name;

    public void study(){
        System.out.println("我在学习");
    }
}

interface Person{
    void delete();
}